package com.tpsoft.sys.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.tpsoft.sys.domain.Role;

public interface RoleRepository extends JpaRepository<Role, Long> {

	@Query(nativeQuery = true,  value = "SELECT  a.`NAME` AS url ,r.`ROLE_NAME` AS role FROM sys_role r JOIN sys_role_resouces ra ON r.`ROLE_ID`=ra.`ROLE_ID` JOIN sys_resources a ON a.`ID`=ra.`RESOUCES_ID`")
	List<Object[]> getUrlRoles();

}
